﻿<odc:AnimationPhoneApplicationPage x:Class="OdcDemo.JumpListPage"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
        xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:odc="clr-namespace:Odyssey.Controls;assembly=Odyssey"
        xmlns:classes="clr-namespace:Odyssey.Classes;assembly=Odyssey"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
        xmlns:local="clr-namespace:OdcDemo" xmlns:tilt="clr-namespace:ControlTiltEffect" mc:Ignorable="d"
        d:DesignWidth="480" d:DesignHeight="800" d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}"
        FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}"
        Foreground="{StaticResource PhoneForegroundBrush}" SupportedOrientations="PortraitOrLandscape"
        Orientation="Portrait" shell:SystemTray.IsVisible="False" tilt:TiltEffect.IsTiltEnabled="True">

    <odc:AnimationPhoneApplicationPage.Resources>
        <classes:BoolToVisibilityConverter x:Key="boolToVis" />
        <classes:NegBoolToVisibilityConverter x:Key="boolToNegVis" />
        <SolidColorBrush x:Key="dark" Color="Black" Opacity="0.75" />
        <PowerEase x:Key="powerEase" Power="3" EasingMode="EaseOut" />
        <!--<BackEase x:Key="powerEase" EasingMode="EaseOut" />-->
    </odc:AnimationPhoneApplicationPage.Resources>

    <odc:PageTransitionService.PageTransitionGroup>
        <odc:PageAnimationGroup>
            <odc:TurnstileAnimation SwingMode="SwingIn" ItemDelay="0:0:0.05" />
        </odc:PageAnimationGroup>
    </odc:PageTransitionService.PageTransitionGroup>

    <!--Data context is set to sample data above and LayoutRoot contains the root grid where all other page content is placed-->
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>


        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="ODYSSEY" Style="{StaticResource PhoneTextNormalStyle}" />
            <TextBlock x:Name="PageTitle" Text="OdcListBox" Margin="9,-7,0,0"
                    Style="{StaticResource PhoneTextTitle1Style}" />
        </StackPanel>

        <!--ContentPanel contains ListBox and ListBox ItemTemplate. Place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <odc:OdcListBox x:Name="MainListBox" Margin="0,0,-12,0" ItemsSource="{Binding CollectionView}"
                    ScrollingChanged="OnScrollingChanged" SelectionChanged="MainListBox_SelectionChanged">

                <odc:OdcListBox.ItemTemplate>
                    <DataTemplate>
                        <odc:StatefulControl x:Name="control" Height="90" State="{Binding State}">
                            <StackPanel Margin="0,0,0,17" Width="432">
                                
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="ItemStates">
                                        <VisualStateGroup.Transitions>
                                            <VisualTransition To="Unloaded" GeneratedDuration="0:0:0.25" />
                                            <VisualTransition To="Loaded" GeneratedDuration="0:0:1" />
                                        </VisualStateGroup.Transitions>
                                        <VisualState x:Name="Unloaded" />
                                        <VisualState x:Name="Loaded">
                                            <VisualState.Storyboard>
                                                <Storyboard>
                                                    <DoubleAnimation Storyboard.TargetName="details"
                                                            Storyboard.TargetProperty="Opacity" To="1" />
                                                </Storyboard>
                                            </VisualState.Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>                                    
                                </VisualStateManager.VisualStateGroups>
                                
                                <TextBlock x:Name="textItem" Text="{Binding LineOne}" TextWrapping="Wrap"
                                        Style="{StaticResource PhoneTextExtraLargeStyle}" />
                                <TextBlock x:Name="details" Text="{Binding LineTwo}" TextWrapping="Wrap"
                                        Margin="12,-6,12,0" Opacity="0.0" Style="{StaticResource PhoneTextSubtleStyle}">
                                    <TextBlock.RenderTransform>
                                        <TranslateTransform x:Name="translateX" X="0" />
                                    </TextBlock.RenderTransform>
                                </TextBlock>
                            </StackPanel>
                        </odc:StatefulControl>
                        
                    </DataTemplate>
                </odc:OdcListBox.ItemTemplate>

            </odc:OdcListBox>
        </Grid>
    </Grid>

</odc:AnimationPhoneApplicationPage>